package com.zone.component_home.di

import androidx.lifecycle.ViewModel
import com.zone.component_home.repository.DataHttpRepository
import com.zone.component_home.viewmodel.AdventureViewModel
import com.zone.component_home.viewmodel.ChatViewModel
import com.zone.component_home.viewmodel.HomeActivityVM
import com.zone.component_home.viewmodel.MineViewModel
import com.zone.component_home.viewmodel.SquareViewModel
import com.zone.core.id.ViewModelKey
import dagger.Module
import dagger.Provides
import dagger.multibindings.IntoMap

/**
 *Author: last
 *Time: 2020/5/2
 *Description: xxx
 */
@Module
class VMModule {

    @Provides
    @IntoMap
    @ViewModelKey(HomeActivityVM::class)
    fun getBaseActivityVM(): ViewModel {
        return HomeActivityVM("测试")
    }

    @Provides
    @IntoMap
    @ViewModelKey(AdventureViewModel::class)
    fun getAdventureViewModel(str: String): ViewModel {
        return AdventureViewModel(str)
    }

    @Provides
    @IntoMap
    @ViewModelKey(ChatViewModel::class)
    fun getChatViewModel(): ViewModel {
        return ChatViewModel()
    }

    @Provides
    @IntoMap
    @ViewModelKey(MineViewModel::class)
    fun getMineViewModel(): ViewModel {
        return MineViewModel()
    }

    @Provides
    @IntoMap
    @ViewModelKey(SquareViewModel::class)
    fun getSquareViewModel(dataHttpRepository: DataHttpRepository): ViewModel {
        return SquareViewModel(dataHttpRepository)
    }

}